
package com.gotobject.junit;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;

/**
 *
 * @author Huascar A. Sanchez (huascar.sanchez@gmail.com)
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface If {

	/** Helper class to recognize a not set callee. */
	class Nobody {
		private Nobody(){}
	}

	/**
	 * Attribute for the method to be called for the prerequsite. Which does NOT
	 * have a default name.
	 *
	 * @return the method name as string
	 */
	String condition();

	/**
	 * Attribute which indicates what the {@link #condition} should be.
	 * If the user does not specify that value. the default value will be
	 * {@code true}.
	 *
	 * @return what you expect of the condition to be.
	 */
	boolean is() default true;

	/**
	 * The class to be called. The default value {@code NoCallee} means, call
	 * the test class itself.
	 *
	 * @return the class to be called when checking prerequisite
	 */
	Class<?> callee() default Nobody.class;
}
